# -*- coding: utf-8 -*-
# @Author: Cursor
# @Date: 2025-01-04
# @Last Modified by: Tim Liu
# @Last Modified time: 2024-01-04

# @Description: base document processor for ingestion


from abc import ABC, abstractmethod
from typing import Optional  # Add this import
from crewplus.apps.rag.schemas import Document  
from crewplus.apps.rag.schemas.ingest_request import IngestRequest
from langchain_core.vectorstores.base import VectorStore
from langchain_core.embeddings import Embeddings

class DocumentProcessor(ABC):
    """Base class for document processor."""
    
    @abstractmethod
    async def process(self, message: IngestRequest, collection_name: str, vector_store: Optional[VectorStore] = None, embeddings: Optional[Embeddings] = None) -> Document:
        """Process the document and return a Document object."""
        raise NotImplementedError
    